package service_sys

import (
	"strings"
	"wrblog-api-go/app/dao/dao_sys"
	"wrblog-api-go/app/model/model_sys"
	"wrblog-api-go/pkg/utils"
)

func GetSysPostPageList(sysPost model_sys.SelectSysPost) ([]model_sys.SysPostVo, int64, error) {
	return dao_sys.GetSysPostPageList(sysPost)
}

func GetSysPostById(postId int) (model_sys.SysPostVo, error) {
	return dao_sys.GetSysPostById(postId)
}

func AddSysPost(sysPost model_sys.SysPostPo) (int, error) {
	sysPost.CreateTime = utils.NewTimeNow()
	return dao_sys.AddSysPost(sysPost)
}
func EditSysPost(sysPost model_sys.SysPostPo) (int64, error) {
	sysPost.UpdateTime = utils.NewTimeNow()
	return dao_sys.EditSysPost(sysPost)
}

func RemoveSysPost(postIds string, uk string) (int64, error) {
	return dao_sys.RemoveSysPost(strings.Split(postIds, ","), uk)
}
